<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
                "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
  <title>Description of matrix</title>
  <meta name="keywords" content="matrix">
  <meta name="description" content="Converts a vector to a matrix in the QTT-Tucker format">
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  <meta name="generator" content="m2html v1.5 &copy; 2003-2005 Guillaume Flandin">
  <meta name="robots" content="index, follow">
  <link type="text/css" rel="stylesheet" href="../../m2html.css">
</head>
<body>
<a name="_top"></a>
<div><a href="../../index.html">Home</a> &gt;  <a href="#">tt2</a> &gt; <a href="index.html">@qtt_tucker</a> &gt; matrix.m</div>

<!--<table width="100%"><tr><td align="left"><a href="../../index.html"><img alt="<" border="0" src="../../left.png">&nbsp;Master index</a></td>
<td align="right"><a href="index.html">Index for tt2/@qtt_tucker&nbsp;<img alt=">" border="0" src="../../right.png"></a></td></tr></table>-->

<h1>matrix
</h1>

<h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
<div class="box"><strong>Converts a vector to a matrix in the QTT-Tucker format</strong></div>

<h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
<div class="box"><strong>function [qt]=matrix(qt, sz1, sz2) </strong></div>

<h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
<div class="fragment"><pre class="comment">Converts a vector to a matrix in the QTT-Tucker format
   [QT]=MATRIX(QT, SZ1, SZ2) Makes factors of QTT-Tucker to be TT-matrices
   SZ1 and SZ2 are cell arrays with N, M dimensions for each factor
   If they are absent, the square matrices are assumed
 


 TT-Toolbox 2.2, 2009-2012

This is TT Toolbox, written by Ivan Oseledets et al.
Institute of Numerical Mathematics, Moscow, Russia
webpage: http://spring.inm.ras.ru/osel

For all questions, bugs and suggestions please mail
ivan.oseledets@gmail.com
---------------------------</pre></div>

<!-- crossreference -->
<h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
This function calls:
<ul style="list-style-image:url(../../matlabicon.gif)">
<li><a href="../../tt2/@tt_matrix/tt_matrix.html" class="code" title="function t = tt_matrix(varargin)">tt_matrix</a>	TT_matrix class constructor</li></ul>
This function is called by:
<ul style="list-style-image:url(../../matlabicon.gif)">
</ul>
<!-- crossreference -->



<h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
<div class="fragment"><pre>0001 <a name="_sub0" href="#_subfunctions" class="code">function [qt]=matrix(qt, sz1, sz2)</a>
0002 <span class="comment">%Converts a vector to a matrix in the QTT-Tucker format</span>
0003 <span class="comment">%   [QT]=MATRIX(QT, SZ1, SZ2) Makes factors of QTT-Tucker to be TT-matrices</span>
0004 <span class="comment">%   SZ1 and SZ2 are cell arrays with N, M dimensions for each factor</span>
0005 <span class="comment">%   If they are absent, the square matrices are assumed</span>
0006 <span class="comment">%</span>
0007 <span class="comment">%</span>
0008 <span class="comment">%</span>
0009 <span class="comment">% TT-Toolbox 2.2, 2009-2012</span>
0010 <span class="comment">%</span>
0011 <span class="comment">%This is TT Toolbox, written by Ivan Oseledets et al.</span>
0012 <span class="comment">%Institute of Numerical Mathematics, Moscow, Russia</span>
0013 <span class="comment">%webpage: http://spring.inm.ras.ru/osel</span>
0014 <span class="comment">%</span>
0015 <span class="comment">%For all questions, bugs and suggestions please mail</span>
0016 <span class="comment">%ivan.oseledets@gmail.com</span>
0017 <span class="comment">%---------------------------</span>
0018 
0019 <span class="keyword">if</span> (nargin&lt;3)
0020     sz1 = [];
0021     sz2 = [];
0022 <span class="keyword">end</span>;
0023 
0024 d = qt.dphys;
0025 <span class="keyword">for</span> i=1:d
0026     <span class="keyword">if</span> (~isempty(sz1))||(~isempty(sz2))
0027         qt.tuck{i} = <a href="../../tt2/@tt_matrix/tt_matrix.html" class="code" title="function t = tt_matrix(varargin)">tt_matrix</a>(qt.tuck{i}, sz1{i}, sz2{i});
0028     <span class="keyword">else</span>
0029         cursz = qt.tuck{i}.n;
0030         cursz = sqrt(cursz);
0031         qt.tuck{i} = <a href="../../tt2/@tt_matrix/tt_matrix.html" class="code" title="function t = tt_matrix(varargin)">tt_matrix</a>(qt.tuck{i}, cursz, cursz);
0032     <span class="keyword">end</span>;
0033 <span class="keyword">end</span>;
0034 
0035 <span class="keyword">end</span></pre></div>
<hr><address>Generated on Wed 08-Feb-2012 18:20:24 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
</body>
</html>